package br.org.etec.dotcao.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Table(name = "tnewscomment")
@Entity
public class NewsComment extends Comment {

	private static final long serialVersionUID = 1L;

	@ManyToOne
	@JoinColumn(name = "news")
	private News news;

	@ManyToOne
	@JoinColumn(name = "target")
	private NewsComment target;

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "target")
	private List<NewsComment> comments;

	public News getNews() {
		return news;
	}

	public void setNews(News news) {
		this.news = news;
	}

	public NewsComment getTarget() {
		return target;
	}

	public void setTarget(NewsComment target) {
		this.target = target;
	}

	public List<NewsComment> getComments() {
		return comments;
	}

	public void setComments(List<NewsComment> comments) {
		this.comments = comments;
	}

}
